"app"


/**
 * 配置
 */
const { url, device_id, deviceWidth, deviceHeight, randomSleep, deleteDirCache, 
    waitForAndClick, waitForAndSetText, exitAppAndJs
} = require("/sdcard/Download/js/config.js");

    // 发送成功绑定
    log("/device/upload/status" + device_id)
    var res = httpPostData_JSON("/device/upload/status", {
        deviceId: device_id,
        status: 1
    }) 
    log(res)





/**
 * @description 进行post请求服务器
 * @param {string} urlPath 请求路径
 * @param {json} uploadData 必须是json格式的数据
 */
function httpPostData_JSON (urlPath, uploadData){
    // 如果uploadData不为null，则添加deviceId
    if(uploadData != null){
        uploadData.deviceId = device_id
    }else{
        uploadData = {
            "deviceId": device_id
        }
    }
    var res = http.post(url+urlPath,uploadData);
    return res.body.json();
}
